<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="" method="post" id="cp-form" enctype="multipart/form-data">
            <div class="layui-tab">
                <ul class="layui-tab-title">
                    <li class="layui-this">基础</li>
                    <li>SEO设置</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form-item">
                            <label class="layui-form-label">应用名称 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="text" name="app_name"  value="{$apps.app_name}" required lay-verify="required" placeholder="应用名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">下载次数 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="text" name="app_install"   value="{$apps.app_install|default=''}" required lay-verify="required" placeholder="下载次数" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">应用状态 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="radio" name="app_status" class="layui-input" title="上架" value="1" {if isset($apps.app_status) and $apps.app_status eq 1}checked{/if}>
                                <input type="radio" name="app_status" class="layui-input" title="下架" value="0" {if isset($apps.app_status) and $apps.app_status eq 0}checked{/if}>
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label">是否收费 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <div class="layui-col-md2">
                                    <input type="radio" name="is_free" class="layui-input" title="否" value="0" checked lay-filter="isfree" >
                                    <input type="radio" name="is_free" class="layui-input" title="是" value="1" {$apps.is_free == 1}checked{/if} lay-filter="isfree" >
                                </div>
                                <div class="layui-col-md4 price" {if $apps.is_free == 0}style="display: none"{/if}>
                                    <input type="text" class="layui-input" placeholder="请填入价格" value="{$apps.price|default=0}" name="price">
                                    <div class="layui-word-aux">实际价格</div>
                                </div>
                                <div class="layui-col-md3 price"  {if $apps.is_free == 0}style="display: none"{/if}>
                                    <input type="text" class="layui-input" placeholder="请填入划线价格" value="{$apps.line_price|default=0}" name="line_price">
                                    <div class="layui-word-aux">划线价格</div>
                                </div>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">是否推荐 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="radio" name="is_reco" class="layui-input" title="否" value="0" checked>
                                <input type="radio" name="is_reco" class="layui-input" title="是" value="1" {$apps.is_reco == 1}checked{/if}>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">是否置顶 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="radio" name="is_top" class="layui-input" title="否" value="0" checked>
                                <input type="radio" name="is_top" class="layui-input" title="是" value="1" {$apps.is_top == 1}checked{/if}>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">开启评论 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="radio" name="is_comment" class="layui-input" title="是" value="1" checked >
                                <input type="radio" name="is_comment" class="layui-input" title="否" value="0" {$apps.is_comment == 0}checked{/if}>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">应用分类 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <input type="hidden" name="parent_id" value="{$apps.parent_id|default=0}">
                                <input type="hidden" name="category_id" value="{$apps.categoryIdList|default=''}">
                                <input type="text" placeholder="{$apps.categoryNameLst|default='请选择分类'}" data-url="{:url('admin/steward.category/addcategory')}" class="layui-input menuLevel">
                            </div>
                        </div>


                        <div class="layui-form-item">
                            <label class="layui-form-label">应用封面 <span class="request-tips">*</span></label>
                            <div class="layui-input-block">
                                <button type="button" class="layui-btn" id="test1">
                                    <i class="layui-icon">&#xe67c;</i>上传封面
                                </button>
                            </div>
                            <div class="layui-input-block">
                                <table class="layui-table" id="app-photo">
                                    <tr>
                                        <td>
                                            <input type="text" class="layui-input" name="app_photo" value="{$apps.app_photo}">
                                        </td>
                                        <td>
                                            <img src="{:_get_image_preview_url($apps.app_photo)}" alt="" width="150" height="150">
                                        </td>
                                        <td>
                                            <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs del-photos-btn">删除</a>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">应用相册</label>
                            <div class="layui-input-block">
                                <button type="button" class="layui-btn" id="test2">
                                    <i class="layui-icon">&#xe67c;</i>上传相册
                                </button>
                            </div>
                            <div class="layui-input-block">
                                <table class="layui-table" id="app-photos">
                                    {volist name='$apps.app_photos' id='v'}
                                    <tr>
                                        <td>
                                            <input type="text" class="layui-input" name="app_photos[]" value="{$v}">
                                        </td>
                                        <td>
                                            <img src="{$v}" alt="" width="150" height="150">
                                        </td>
                                        <td>
                                            <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs del-photos-btn">删除</a>
                                        </td>
                                    </tr>
                                    {/volist}
                                </table>
                            </div>
                        </div>
                    </div>

                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">SEO标题</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_seo_title"  value="{$apps.app_seo_title}"  placeholder="SEO标题" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">SEO关键词</label>
                            <div class="layui-input-block">
                                <input type="text" name="app_seo_keywords"  value="{$apps.app_seo_keywords}"  placeholder="SEO关键词" autocomplete="off" class="layui-input">
                                <div class="layui-form-mid layui-word-aux">多个请用英文 , 隔开</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">SEO描述</label>
                            <div class="layui-input-block">
                                <textarea name="app_seo_desc" id="" cols="30" rows="10" class="layui-textarea">{$apps.app_seo_desc}</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">软件介绍</label>
                            <div class="layui-input-block">
                                <script id="container" type="text/plain" name="app_contents">{$apps.app_contents|raw}</script>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">购买说明</label>
                            <div class="layui-input-block">
                                <script id="buydesc" type="text/plain" name="buy_desc">{$apps.buy_desc|raw}</script>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" value="{$apps.id|default=0}">
                    <div class="layui-text">带 * 号的为必填项</div>
                    <button class="layui-btn" lay-submit lay-filter="formDemo">保存</button>
                    <a href="javascript:history.go(-1);" class="layui-btn layui-btn-primary">返回</a>
                    <input type="hidden" name="user_id" value="{$apps.user_id}">
                </div>
            </div>
        </form>
    </div>
</div>
